package cn.net.lisong.blog.utils;

import java.util.HashMap;
import java.util.Map;

import cn.net.lisong.blog.service.impl.UserServiceImpl;

/**
 * Bean 单例工厂
 * @author lisong
 *
 */
public class BeanFactory {

	private static BeanFactory instance = new BeanFactory();
	
	private Map<String, Object> beans = new HashMap<String, Object>();
	
	private BeanFactory(){
		beans.put("userService", new UserServiceImpl());
	}
	
	public static BeanFactory getInstance() {
		return instance;
	}
	
	public static Object getBean(String beanName) {
		return instance.beans.get(beanName);
	}

	public Map<String, Object> getBeans() {
		return beans;
	}

}
